#include <stdio.h>

#include <FinalCType/String.h>

int	main(int argc, char **argv)
{
    printf("Hello World\n");

    String *ports = createStringWith_cstr("10752-10757");
    if (stringContains_char(ports, '-')) {
        printf("check: %s\n", ports->value);

        int onlyPortBetween = true;
        List *words = stringSplit_cnt(ports, '-', 1);
        if (listLength(words) == 2) {
            int start_port = atoi(convString(listIndex(words, 0)->data)->value);
            int end_port =atoi(convString(listIndex(words, 1)->data)->value);
            printf("%d -> %d\n", start_port, end_port);
            printf("%s -> %s\n",convString(listIndex(words, 0)->data)->value
                                ,convString(listIndex(words, 1)->data)->value);
        }
        deleteListWithFunc(words, (FinalCDeleteFunc)deleteString);
    }
    destroyString(ports);

    return 0;
}
